package com.scrawler.vo;

import com.scrawler.util.ConstantUtils;






/**  
 * @Description: 描述	CMS库中取出的数据对象.
 * @author kuntang    
 * @version 1.0  
 * @created 2012-10-25 下午4:39:34 
 * Copyright (c) 2012 sohu,Inc. All Rights Reserved.
 */

public class News implements Comparable<News>{

	private int nid;
	private String msg;
	private int code;
	private String create_time;
	private String keywords;
	private String content;
	private int channel_id;
	private String www_update_time;
	private int image_count;
	private String redirect_url;
	private String pid;
	private String title;
	private String last_update_time;
	private int priority;
	// 短标题
	private String sub_title;
	/** 新闻类型,3为图文新闻*/
	private int newsType;
	/** 新闻摘要 */
	private String abstractInfo;
	
	/**推荐产生的中间数据*/
	// 最终得分
	private float score;
	//视觉信息得分
	private float pageViewScore;
	// baidu 热词信息得分
	private float baiduHotwordScore;
	// 时间因素降权
	private float timeScore;
	
	public float getTimeScore() {
		return timeScore;
	}
	public void setTimeScore(float timeScore) {
		this.timeScore = timeScore;
	}
	public float getScore() {
		return score;
	}
	public void setScore(float score) {
		this.score = score;
	}
	public float getPageViewScore() {
		return pageViewScore;
	}
	public void setPageViewScore(float pageViewScore) {
		this.pageViewScore = pageViewScore;
	}
	public float getBaiduHotwordScore() {
		return baiduHotwordScore;
	}
	public void setBaiduHotwordScore(float baiduHotwordScore) {
		this.baiduHotwordScore = baiduHotwordScore;
	}
	public String getAbstractInfo() {
		return abstractInfo;
	}
	public void setAbstractInfo(String abstractInfo) {
		this.abstractInfo = abstractInfo;
	}
	public int getNewsType() {
		return newsType;
	}
	public void setNewsType(int newsType) {
		this.newsType = newsType;
	}
	public String getSub_title() {
		return sub_title;
	}
	public void setSub_title(String sub_title) {
		this.sub_title = sub_title;
	}
	public String getLast_update_time() {
		return last_update_time;
	}
	public void setLast_update_time(String last_update_time) {
		this.last_update_time = last_update_time;
	}
	public int getNid() {
		return nid;
	}
	public void setNid(int nid) {
		this.nid = nid;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public String getPid() {
		return pid;
	}
	public void setPid(String pid) {
		this.pid = pid;
	}
	public String getCreate_time() {
		return create_time;
	}
	public void setCreate_time(String create_time) {
		this.create_time = create_time;
	}
	public String getKeywords() {
		return keywords;
	}
	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public int getChannel_id() {
		return channel_id;
	}
	public void setChannel_id(int channel_id) {
		this.channel_id = channel_id;
	}
	public String getWww_update_time() {
		return www_update_time;
	}
	public void setWww_update_time(String www_update_time) {
		this.www_update_time = www_update_time;
	}
	public int getImage_count() {
		return image_count;
	}
	public void setImage_count(int image_count) {
		this.image_count = image_count;
	}
	public String getRedirect_url() {
		return redirect_url;
	}
	public void setRedirect_url(String redirect_url) {
		this.redirect_url = redirect_url;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public int getPriority() {
		return priority;
	}
	public void setPriority(int priority) {
		this.priority = priority;
	}
	
	public String toString(){
		StringBuilder sb = new StringBuilder();
		sb.append(this.getTitle()).append(",")
		.append(this.getCreate_time()).append(",")
		.append(this.getPageViewScore()).append("|")
		.append(this.getBaiduHotwordScore()).append("|")
		.append(this.getTimeScore()).append("===>")
		.append(this.getScore()).append(ConstantUtils.NEW_LINE);
		return sb.toString();
	}
	
	/**   
	* @param o
	* @return  
	* @see java.lang.Comparable#compareTo(java.lang.Object)  
	*/
	@Override
	public int compareTo(News o) {
		// TODO Auto-generated method stub
		return this.getScore()-o.getScore()>0?1:-1;
	}

}
